package com.woniu.map.controller;


import com.woniu.internalcommon.dto.ForecastPriceDTO;
import com.woniu.internalcommon.dto.ResponseResult;
import com.woniu.internalcommon.response.DirectionResponse;
import com.woniu.map.service.DirectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/driving")
public class DriectionController {

    @Autowired
    private DirectionService directionService;

    /**
     * 获取导航信息 路径规划
     * @param forecastPriceDTO
     * @return
     */


    @PostMapping("/direction")
    public ResponseResult<DirectionResponse> direction(@RequestBody ForecastPriceDTO forecastPriceDTO){

        String depLongitude = forecastPriceDTO.getDepLongitude();
        String depLatitude = forecastPriceDTO.getDepLatitude();
        String destLongitude = forecastPriceDTO.getDestLongitude();
        String destLatitude = forecastPriceDTO.getDestLatitude();

        return directionService.driving(depLongitude,depLatitude,destLongitude,destLatitude);
    }
}
